import express from "express"
const router = express.Router()
import {  protect } from "../middleware/auth.js"

import { 
  getCartItems,
  addProductToCart,
  delProductToCart,
  updateProductToCart
} from "../controllers/cart.js"

router.get("/all", protect, getCartItems)
router.post("/", protect, addProductToCart)
router.route("/:cartId").delete(protect,delProductToCart).put(protect,updateProductToCart)

export default router